﻿@if (false) {<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.min.js" type="text/javascript" />}
@{string list = "list7", pager = "pager7", entity = "Finished";}
<table id="@list" class="scroll" cellpadding="0" cellspacing="0">
</table>
<div id="@pager" class="scroll" style="text-align: center;">
</div>

<script type="text/javascript">
    jQuery(function () {
        $("#@list").jqGrid({
            url: "/@entity/index/",
            colNames: ["物料编号", "物料名称", "型号", "单位"],
            colModel: [
            $.jgridx.strCol("Number"),
            $.jgridx.strCol("Name"),
            $.jgridx.strNullCol("Model"),
            $.jgridx.strNullCol("Unit"),
            ],

            pager: $('#@pager'),
            sortname: "ProductId",
            sortorder: "desc",

            loadComplete: function (data) {

                if (!data.success)
                    $(this).jqGrid("clearGridData", true);
            }
        });
        $("#@list").jqGrid('navGrid', '#@pager',
        {
            edit: true,
            add: true,
            search: true,
            del: true,
            refresh: true
        },
        {
            url: "/@entity/edit/"
        },
        {
            url: "/@entity/add/"
        },
        {
            url: "/@entity/delete/"
        }, {}, {});
    });
</script>